<!DOCTYPE HTML>
<!--
 * @author Nicolas CARPi <nico-git@deltablot.email>
 * @copyright 2012 Nicolas CARPi
 * @see https://www.elabftw.net Official website
 * @license AGPL-3.0
 * @package elabftw
-->
<html lang='{{ App.getLangForHtmlAttribute }}'>

<head>
  <meta http-equiv='Content-type' content='text/html;charset=UTF-8' />
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <meta name='csrf-token' content='{{ App.Csrf.getToken }}'/>
  <link rel='icon' type='image/ico' href='app/img/favicon.ico' />
  <link rel='apple-touch-icon' href='app/img/apple-touch-icon.png' />
  <link rel='apple-touch-icon-precomposed' href='app/img/apple-touch-icon-precomposed.png'>
  <title>{{ block('title') }} - eLabFTW</title>
  <!-- see Gruntfile.js and builder.js to see what gets inside these files -->
  <!-- CSS -->
  <link rel='stylesheet' media='all' href='app/css/elabftw.min.css?v={{ v }}' />
  <link rel='stylesheet' media='all' href='app/css/vendor.min.css?v={{ v }}' />

  <script defer src='app/js/36.bundle.js?v={{ v }}'></script>
  <!-- the main JS bundle with all the elabftw TS code (see builder.js) -->
  <script defer src='app/js/main.bundle.js?v={{ v }}'></script>
  <!-- concatenated JS built by grunt for non es6 libraries (see Gruntfile.js) -->
  <script defer src='app/js/vendor.min.js?v={{ v }}'></script>
  <script defer src='app/js/bootstrap-markdown.min.js?v={{ v }}'></script>

</head>

<body>

<!-- container-fluid is from bootstrap -->
<div id='container' class='container-fluid'>

<!-- begin main menu -->
<nav class='navbar navbar-expand-lg navbar-dark'>
    {% if App.Session.has('is_auth') %}
    <!-- hamburger menu -->
    <button class='navbar-toggler' type='button' data-toggle='collapse' data-target='#main-nav' aria-controls='main-nav' aria-expanded='false' aria-label='Toggle navigation'>
        <span class='navbar-toggler-icon'></span>
    </button>
    {% endif %}
    <!-- logo -->
    <a href='index.php'><img class='navbar-brand' src='app/img/logo-header.png' height='40' alt='elabftw' /></a>

    {% if App.Session.has('is_auth') %}
    <!-- everything in there will be part of the burger -->
    <div class='collapse navbar-collapse' id='main-nav'>
        <div class='navbar-nav'>
            <a class='nav-item nav-link {{ App.Request.getScriptName|split('/')|last == 'experiments.php' ? 'active' }}'
                href='experiments.php'>{% trans %}Experiment{% plural 2 %}Experiments{% endtrans %}</a>
            <a class='nav-item nav-link {{ App.Request.getScriptName|split('/')|last == 'database.php' ? 'active' }}'
                href='database.php'>{{ 'Database'|trans }}</a>

            {% if not App.Session.has('is_anon') %}
            <a class='nav-item nav-link {{ App.Request.getScriptName|split('/')|last == 'team.php' ? 'active' }}'
                href='team.php'>{{ 'Team'|trans }}</a>
            {% endif %}

            <a class='nav-item nav-link {{ App.Request.getScriptName|split('/')|last == 'search.php' ? 'active' }}'
                href='search.php'>{{ 'Search'|trans }}</a>
            <a class='nav-item nav-link' href='{{ App.teamConfigArr.link_href }}' target='_blank' rel='noopener'>{{ App.teamConfigArr.link_name }}</a>

        </div>

        <!-- SEARCH BAR -->
        <form class='nav-item form-inline ml-auto' id='big_search' method='get' action='{{ App.Request.getScriptName }}'>
            {% if App.Request.getScriptName|split('/')|last == 'experiments.php' or App.Request.getScriptName|split('/')|last == 'database.php' %}
            <input class='form-control' type='search' name='q' aria-label='Search' size='20' value='{{ App.Request.query.get('q') }}' />
            {% endif %}
        </form>
        <div class='nav-item dropdown'>
          <a class='nav-link dropdown-toggle' href='#' id='navbarDropdown' role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'><i class='fas fa-user-circle fa-lg' style='font-size: 180%'></i></a>
          <div class='dropdown-menu dropdown-menu-right' aria-labelledby='navbarDropdown'><h6 class='dropdown-header'>{{ 'Logged in as'|trans }} {{ App.Users.userData.firstname|default('Anonymous')|raw }}</h6>
            {% if App.Session.has('is_auth') and not App.Session.has('is_anon') %}
              <a class='dropdown-item' href='ucp.php'><i class='fas fa-cogs fa-fw'></i> {{ 'User panel'|trans }}</a>
              <a class='dropdown-item' href='profile.php'><i class='fas fa-user fa-fw'></i> {{ 'My Profile'|trans }}</a>
              <a class='dropdown-item todoToggle' href='#'><i class='fas fa-list fa-fw'></i> {{ 'Todolist'|trans }}</a>
              {% if App.Session.get('is_admin') %}
                <a class='dropdown-item' href='admin.php'><i class='fas fa-tools fa-fw'></i> {{ 'Admin panel'|trans }}</a>
              {% endif %}
              {% if App.Session.get('is_sysadmin') %}
                <a class='dropdown-item' href='sysconfig.php'><i class='fas fa-tools fa-fw' style='color:#e6614c'></i> {{ 'Sysadmin panel'|trans }}</a>
              {% endif %}

            {% endif %}
            <a class='dropdown-item modalToggle' data-modal='helpModal' href='#'><i class='fas fa-question-circle fa-fw'></i> {{ 'Help'|trans }}</a>
            <div class='dropdown-divider'></div>
            <a class='dropdown-item logout' href='#'><i class='fas fa-sign-out-alt fa-fw'></i> {{ 'Logout'|trans }}</a>
          </div>
        </div>
     </div>
    {% endif %}
</nav>

<div class='real-container'>

<noscript><!-- show warning if javascript is disabled -->
    <div class='alert alert-danger'>
        <p class='font-weight-bold'>Javascript is disabled. Please enable Javascript to view eLabFTW in all its glory.</p>
    </div>
</noscript>

<!-- Modal for help -->
<div class='modal fade' id='helpModal' tabindex='-1' role='dialog' aria-labelledby='helpModalLabel' aria-hidden='true'>
  <div class='modal-dialog' role='document'>
    <div class='modal-content'>
      <div class='modal-header'>
        <h5 class='modal-title' id='helpModalLabel'>{{ 'Help'|trans }}</h5>
        <button type='button' class='close' data-dismiss='modal' aria-label='Close'>
          <span aria-hidden='true'>&times;</span>
        </button>
      </div>
      <div class='modal-body' data-wait='{{ 'Please wait…' }}'>
        <ul>
            <li class='tip'>
                {{ 'There is a manual available %shere%s.'|trans|format("<a href='https://doc.elabftw.net/manual.html'>", "</a>")|raw }}
            </li>
            <li class='tip'>
                {{ "You can use a TODOlist by pressing '%s'."|trans|format(App.Users.userData.sc_todo) }}
            </li>
            <li class='tip'>
                {{ 'You can have experiments templates (%sControl Panel%s).'|trans|format("<a href='ucp.php?tab=3'>", "</a>")|raw }}
            </li>
            <li class='tip'>
                {{ 'You can make links inside the text by typing # and an autocomplete menu will spawn with a list of Experiments/Items.'|trans }}
            </li>
            <li class='tip'>
                {{ 'The admin of a team can edit the status and the types of items available (%sAdmin Panel%s).'|trans|format("<a href='admin.php?tab=4'>", "</a>")|raw }}
            </li>
            <li class='tip'>
                {{ 'If you press Ctrl Shift D in the editor, the date will appear under the cursor.'|trans }}
            </li>
            <li class='tip'>
                {{ 'Custom shortcuts are available (%sControl Panel%s).'|trans|format("<a href='ucp.php?tab=1'>", "</a>")|raw }}
            </li>
            <li class='tip'>
                {{ 'You can duplicate experiments in one click.'|trans }}
            </li>
            <li class='tip'>
                {{ 'Click a tag to list all items with this tag.'|trans }}
            </li>
            <li class='tip'>
                {{ 'Once timestamped an experiment cannot be unlocked or modified. Only comments can be added.'|trans }}
            </li>
        </ul>
      </div>
      <div class='modal-footer'>
        <button type='button' class='btn btn-secondary' data-dismiss='modal'>{{ 'Close'|trans }}</button>
      </div>
    </div>
  </div>
</div>
<!-- TITLE -->
<h2 {% if hideTitle %}style='display:none'{%endif%}>{% block title %}{{ App.pageTitle }}{% endblock %}</h2>

<!-- INFO BOX (FLASH MESSAGES) -->
{% for ok in App.ok %}
  {{ ok|msg('ok') }}
{% endfor %}
{% for ko in App.ko %}
  {{ ko|msg('ko') }}
{% endfor %}
{% for warning in App.warning %}
  {{ warning|msg('warning') }}
{% endfor %}
<!-- ANNOUNCEMENT -->
{% if App.Config.configArr.announcement %}
  {{ App.Config.configArr.announcement|msg('warning') }}
{% endif %}
<div id='output'></div>
